package com.sczmgk.hotline_pzh.photo.entity;

import com.sczmgk.hotline_pzh.utils.Tools;

import java.io.Serializable;

/**
 * GreadView相册的封装
 * @author bo
 *
 */
public class PhotoItem implements Serializable {
	private static final long serialVersionUID = 8682674788506891598L;
	/**
	 * 相册ID
	 */
	private int photoID;
	/**
	 * 是否选择
	 */
	private boolean select;
	/**
	 * 图片的路径
	 */
	private String photoPath;

	public String getPhotoPath() {
		return photoPath;
	}

	public void setPhotoPath(String photoPath) {
		this.photoPath = photoPath;
	}

	public PhotoItem(int id,String path) {
		photoID = id;
		select = false;
		photoPath=path;
	}
	public PhotoItem(String path) {
		select = false;
		photoPath=path;
	}
	public PhotoItem() {
		select = false;
	}

	public PhotoItem(int id, boolean flag) {
		photoID = id;
		select = flag;
	}

	public int getPhotoID() {
		return photoID;
	}

	public void setPhotoID(int photoID) {
		this.photoID = photoID;
	}

	public boolean isSelect() {
		return select;
	}

	public void setSelect(boolean select) {
		this.select = select;
	}
	
	@Override
	public boolean equals(Object o) {
		if(o instanceof PhotoItem){
			PhotoItem photoItem = (PhotoItem) o;
			if(Tools.equals(photoItem.photoID, photoID) && Tools.equals(photoItem.photoPath , photoPath)){
				return true;
			}
		}
		return false;
	}

	@Override
	public String toString() {
		return "PhotoItem [photoID=" + photoID + ", select=" + select + "]";
	}
}
